﻿// CTile
// © Ren Katims 2013

#region Using Statements
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework;
#endregion

namespace Casters.source
{
    /// <summary>
    /// Tile Class - Stores all relevent information for an individual game tile
    /// </summary>
    public class CTile
    {
        // Variables
        public Vector2     m_vPosition;

        public int  m_nTextureID;
        public int  m_nHeight;
        public int  m_nElementType;
        public int  m_nModifier;
        public Color m_color;
        public bool m_CanMoveTo;
        public bool m_CanAttack;

        // Constructor
        public CTile()
        {
            m_vPosition = Vector2.Zero;

            m_nTextureID = 0;
            m_nHeight = 0;
            m_nElementType = 0;
            m_nModifier = 0;
            m_color = Color.White;
            m_CanMoveTo = false;
            m_CanAttack = false;
        }

        /// <summary>
        /// Overloaded Constructor
        /// </summary>
        /// <param name="_nTextureID">ID of location on tilesheet</param>
        /// <param name="_nElementType">Element Type assigned to the tile</param>
        /// <param name="_nHeight">Height of the Tile</param>
        /// <param name="m_vPosition">Deprecated variable, will be removed in next update</param>
        public CTile(int _nTextureID, int _nElementType, int _nHeight, Vector2 m_vPosition)
        {
            SetupTile(_nTextureID, _nElementType, _nHeight, m_vPosition);
        }

        /// <summary>
        /// SetupTile - Allows instant reallocation of a tile
        /// </summary>
        /// <param name="_nTextureID">ID of location on tilesheet</param>
        /// <param name="_nElementType">Element Type assigned to the tile</param>
        /// <param name="_nHeight">Height of the Tile</param>
        /// <param name="m_vPosition">Deprecated variable, will be removed in next update</param>
        void SetupTile(int _nTextureID, int _nElementType, int _nHeight, Vector2 _vPosition)
        {
            m_vPosition     = _vPosition;
            m_nTextureID    = _nTextureID;
            m_nElementType  = _nElementType;
            m_nHeight       = _nHeight;
            m_color         = Color.White;
            m_CanMoveTo = false;

            // Set Modifier
            if (m_nElementType == 2)
                m_nModifier = 2;
            else
                m_nModifier = 0;
        }
    }
}
